﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptDoanhThuTheoKhuVuc : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CboDonVi")]
        private ComboBox _CboDonVi;
        [AccessedThroughProperty("CboKhuVuc")]
        private ComboBox _CboKhuVuc;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdIn")]
        private Button _CmdIn;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("OptChiTiet")]
        private RadioButton _OptChiTiet;
        [AccessedThroughProperty("OptTongHop")]
        private RadioButton _OptTongHop;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSListDoanhThu")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSListDoanhThu;
        private DataView cFrmData;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsDMKhuVuc objKV;
        private clsXuatKho objXK;

        public Frm_RptDoanhThuTheoKhuVuc()
        {
            base.Load += new EventHandler(this.Frm_RptDoanhThuTheoKhuVuc_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objKV = new clsDMKhuVuc();
            this.objXK = new clsXuatKho();
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdIn_Click(object sender, EventArgs e)
        {
            if (this.OptTongHop.Checked & !this.OptChiTiet.Checked)
            {
                this.PrintReportTH();
            }
            else
            {
                this.PrintReportCT();
            }
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_RptDoanhThuTheoKhuVuc_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, true, "", "");
                BuildComboModule.BuildCombo(this.CboKhuVuc, modGeneral.ListDanhMuc.KhuVuc, true, "", "");
                this.CboDonVi.SelectedValue = modGeneral.H_CLIENT;
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.LoadData();
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptDoanhThuTheoKhuVuc));
            this.CboDonVi = new ComboBox();
            this.Label1 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.TxtTuNgay = new DateTimePicker();
            this.Label13 = new Label();
            this.Label3 = new Label();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.VSListDoanhThu = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1 = new Panel();
            this.CmdIn = new Button();
            this.OptTongHop = new RadioButton();
            this.OptChiTiet = new RadioButton();
            this.CboKhuVuc = new ComboBox();
            this.Label2 = new Label();
            this.Panel2 = new Panel();
            this.VSListDoanhThu.BeginInit();
            this.Panel1.SuspendLayout();
            this.SuspendLayout();
            this.CboDonVi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboDonVi.FormattingEnabled = true;
            Point point = new Point(0xc4, 0x17);
            this.CboDonVi.Location = point;
            this.CboDonVi.Name = "CboDonVi";
            Size size = new Size(0x88, 0x15);
            this.CboDonVi.Size = size;
            this.CboDonVi.TabIndex = 60;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0xc3, 5);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x26, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3b;
            this.Label1.Text = "Đơn vị";
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x62, 0x17);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x5b, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x31;
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new Point(6, 0x17);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x56, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x30;
            DateTime time = new DateTime(0x7d7, 11, 1, 0, 0, 0, 0);
            this.TxtTuNgay.Value = time;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(3, 5);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 50;
            this.Label13.Text = "Từ ng\x00e0y";
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(0x5f, 5);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x35, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x33;
            this.Label3.Text = "Đến ng\x00e0y";
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(800, 20);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x52, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x3f;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x273, 20);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x51, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 0x3e;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.VSListDoanhThu.AutoResize = false;
            this.VSListDoanhThu.BackColor = Color.WhiteSmoke;
            this.VSListDoanhThu.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSListDoanhThu.ColumnInfo = manager.GetString("VSListDoanhThu.ColumnInfo");
            this.VSListDoanhThu.Dock = DockStyle.Fill;
            this.VSListDoanhThu.ExtendLastCol = true;
            this.VSListDoanhThu.FocusRect = FocusRectEnum.None;
            point = new Point(0, 0x2f);
            this.VSListDoanhThu.Location = point;
            this.VSListDoanhThu.Name = "VSListDoanhThu";
            this.VSListDoanhThu.Rows.Count = 1;
            this.VSListDoanhThu.Rows.DefaultSize = 0x11;
            this.VSListDoanhThu.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x37e, 0x1f6);
            this.VSListDoanhThu.Size = size;
            this.VSListDoanhThu.StyleInfo = manager.GetString("VSListDoanhThu.StyleInfo");
            this.VSListDoanhThu.TabIndex = 0x40;
            this.VSListDoanhThu.VisualStyle = VisualStyle.Office2007Blue;
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CmdIn);
            this.Panel1.Controls.Add(this.OptTongHop);
            this.Panel1.Controls.Add(this.OptChiTiet);
            this.Panel1.Controls.Add(this.CboKhuVuc);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.CboDonVi);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Controls.Add(this.Label3);
            this.Panel1.Controls.Add(this.CmdCancel);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.CmdOK);
            this.Panel1.Dock = DockStyle.Top;
            point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x37e, 0x2f);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x42;
            this.CmdIn.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdIn.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x2c9, 20);
            this.CmdIn.Location = point;
            this.CmdIn.Name = "CmdIn";
            size = new Size(0x51, 0x18);
            this.CmdIn.Size = size;
            this.CmdIn.TabIndex = 0x44;
            this.CmdIn.Text = "&Trang in";
            this.CmdIn.UseVisualStyleBackColor = true;
            this.OptTongHop.AutoSize = true;
            this.OptTongHop.BackColor = Color.Transparent;
            this.OptTongHop.Checked = true;
            point = new Point(0x210, 0x30);
            this.OptTongHop.Location = point;
            this.OptTongHop.Name = "OptTongHop";
            size = new Size(0x47, 0x11);
            this.OptTongHop.Size = size;
            this.OptTongHop.TabIndex = 0x43;
            this.OptTongHop.TabStop = true;
            this.OptTongHop.Text = "Tổng hợp";
            this.OptTongHop.UseVisualStyleBackColor = false;
            this.OptChiTiet.AutoSize = true;
            this.OptChiTiet.BackColor = Color.Transparent;
            point = new Point(0x26a, 0x30);
            this.OptChiTiet.Location = point;
            this.OptChiTiet.Name = "OptChiTiet";
            size = new Size(0x39, 0x11);
            this.OptChiTiet.Size = size;
            this.OptChiTiet.TabIndex = 0x42;
            this.OptChiTiet.Text = "Chi tiết";
            this.OptChiTiet.UseVisualStyleBackColor = false;
            this.CboKhuVuc.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboKhuVuc.FormattingEnabled = true;
            point = new Point(0x152, 0x17);
            this.CboKhuVuc.Location = point;
            this.CboKhuVuc.Name = "CboKhuVuc";
            size = new Size(0xb9, 0x15);
            this.CboKhuVuc.Size = size;
            this.CboKhuVuc.TabIndex = 0x41;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(0x151, 5);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x2f, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x40;
            this.Label2.Text = "Khu vực";
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel2.BackgroundImageLayout = ImageLayout.Stretch;
            this.Panel2.Dock = DockStyle.Bottom;
            point = new Point(0, 0x225);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x37e, 0x13);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x43;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x238);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.VSListDoanhThu);
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.Panel2);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_RptDoanhThuTheoKhuVuc";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-BH07             ";
            this.Text = "DOANH THU THEO KHU VUC";
            this.VSListDoanhThu.EndInit();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            int num;
            string str;
            this.Cursor = Cursors.WaitCursor;
            if (this.OptTongHop.Checked)
            {
                str = "TH";
            }
            else
            {
                str = "CT";
            }
            DataTable table = this.objXK.GetDataPrintDoanhThuTheoKhuVuc(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text).Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhuVuc.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), str);
            this.VSListDoanhThu.Rows.Count = 1;
            if (str == "CT")
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSListDoanhThu = this.VSListDoanhThu;
                int num2 = table.Rows.Count - 1;
                for (num = 0; num <= num2; num++)
                {
                    vSListDoanhThu.AddItem("");
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TenKhuVuc"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(table.Rows[num]["Ngay"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[num]["SoChungTu"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[num]["KhachHang"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(table.Rows[num]["LoaiTien"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TyGia"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TienHang"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[num]["ChietKhau"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TienThue"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TongTien"]);
                    vSListDoanhThu[vSListDoanhThu.Rows.Count - 1, 10] = Conversions.ToDouble(table.Rows[num]["TongTien"]) * Conversions.ToDouble(table.Rows[num]["TyGia"]);
                }
                vSListDoanhThu.Cols[0].Visible = false;
                vSListDoanhThu.Cols[1].Visible = true;
                vSListDoanhThu.Cols[2].Visible = true;
                vSListDoanhThu.Cols[3].Visible = true;
                vSListDoanhThu.Cols[5].Visible = true;
                vSListDoanhThu.Tree.Column = 3;
                vSListDoanhThu.Subtotal(AggregateEnum.Sum, 0, 0, 0, 10, "{0}");
                vSListDoanhThu = null;
            }
            else
            {
                C1.Win.C1FlexGrid.C1FlexGrid grid2 = this.VSListDoanhThu;
                int num3 = table.Rows.Count - 1;
                for (num = 0; num <= num3; num++)
                {
                    grid2.AddItem("");
                    grid2[grid2.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TenKhuVuc"]);
                    grid2[grid2.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TienHang"]);
                    grid2[grid2.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TienChietKhau"]);
                    grid2[grid2.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TienThue"]);
                    grid2[grid2.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(table.Rows[num]["TongCong"]);
                    grid2[grid2.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(table.Rows[num]["QuyDoi"]);
                }
                grid2.Cols[0].Visible = true;
                grid2.Cols[1].Visible = false;
                grid2.Cols[2].Visible = false;
                grid2.Cols[3].Visible = false;
                grid2.Cols[5].Visible = false;
                grid2.AddItem("");
                grid2[grid2.Rows.Count - 1, 0] = "TỔNG CỘNG:";
                int num4 = grid2.Cols.Count - 1;
                for (num = 6; num <= num4; num++)
                {
                    grid2[grid2.Rows.Count - 1, num] = LVYModule.SumColGrid(this.VSListDoanhThu, num);
                }
                LVYModule.SetColorForGrid(this.VSListDoanhThu, Color.GreenYellow, grid2.Rows.Count - 1, 0, 0, 0);
                grid2 = null;
            }
            this.Cursor = Cursors.Default;
        }

        private void OptTongHop_CheckedChanged(object sender, EventArgs e)
        {
            this.LoadData();
        }

        public void PrintReportCT()
        {
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "")), this.VSListDoanhThu, 0, 1, "");
            this.Cursor = Cursors.WaitCursor;
            DataTable dataTable = this.objXK.GetDataPrintDoanhThuTheoKhuVuc(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhuVuc.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), "CT");
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeDoanhThuTheoLoaiKVCT ikvct = new Rpt_BangKeDoanhThuTheoLoaiKVCT();
                try
                {
                    ikvct.SetDataSource(dataTable);
                    ikvct.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        ikvct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        ikvct.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    ikvct.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESSVIET);
                    ikvct.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    ikvct.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    ikvct.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    ikvct.SetParameterValue(5, modGeneral.Tranlated("DOANH THU THEO KHU VỰC", ""));
                    ikvct.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    ikvct.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    ikvct.SetParameterValue(8, modGeneral.Tranlated("Số chứng từ", ""));
                    ikvct.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y", ""));
                    ikvct.SetParameterValue(10, modGeneral.Tranlated("T\x00ean khu vực", ""));
                    ikvct.SetParameterValue(11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    ikvct.SetParameterValue(12, modGeneral.Tranlated("Chiết khấu", ""));
                    ikvct.SetParameterValue(13, modGeneral.Tranlated("Tiền thuế", ""));
                    ikvct.SetParameterValue(14, modGeneral.Tranlated("Kh\x00e1ch h\x00e0ng", ""));
                    ikvct.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    ikvct.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    ikvct.SetParameterValue(0x11, modGeneral.Tranlated("Lập biểu", ""));
                    ikvct.SetParameterValue(0x12, modGeneral.Tranlated("Cộng", ""));
                    ikvct.SetParameterValue(0x13, modGeneral.Tranlated("Loại tiền", ""));
                    ikvct.SetParameterValue(20, modGeneral.Tranlated("Tỷ gi\x00e1", ""));
                    ikvct.SetParameterValue(0x15, modGeneral.Tranlated("Quy đổi", ""));
                    ikvct.SetParameterValue(0x16, modGeneral.Tranlated("Tổng cộng", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ikvct;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        public void PrintReportTH()
        {
            ReportModule.InitDuLieuDanhMuc(Conversions.ToString(modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "")), this.VSListDoanhThu, 0, 1, "");
            this.Cursor = Cursors.WaitCursor;
            DataTable dataTable = this.objXK.GetDataPrintDoanhThuTheoKhuVuc(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text).Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhuVuc.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), "TH");
            if (dataTable.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BangKeDoanhThuTheoLoaiKV ikv = new Rpt_BangKeDoanhThuTheoLoaiKV();
                try
                {
                    ikv.SetDataSource(dataTable);
                    ikv.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        ikv.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        ikv.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    ikv.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESSVIET);
                    ikv.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    ikv.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    ikv.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    ikv.SetParameterValue(5, modGeneral.Tranlated("DOANH THU THEO KHU VỰC", ""));
                    ikv.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text);
                    ikv.SetParameterValue(7, modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    ikv.SetParameterValue(8, modGeneral.Tranlated("Loại tiền", ""));
                    ikv.SetParameterValue(9, modGeneral.Tranlated("Cộng", ""));
                    ikv.SetParameterValue(10, modGeneral.Tranlated("Khu vực", ""));
                    ikv.SetParameterValue(11, modGeneral.Tranlated("Tiền h\x00e0ng", ""));
                    ikv.SetParameterValue(12, modGeneral.Tranlated("Chiết khấu", ""));
                    ikv.SetParameterValue(13, modGeneral.Tranlated("Tiền thuế", ""));
                    ikv.SetParameterValue(14, modGeneral.Tranlated("Tổng cộng", ""));
                    ikv.SetParameterValue(15, modGeneral.Tranlated("STT", ""));
                    ikv.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    ikv.SetParameterValue(0x11, modGeneral.Tranlated("Lập biểu", ""));
                    ikv.SetParameterValue(0x12, modGeneral.Tranlated("Quy đổi", ""));
                    ikv.SetParameterValue(0x13, modGeneral.Tranlated("Tổng cộng", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = ikv;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        private void VSListKV_AfterEdit(object sender, RowColEventArgs e)
        {
            if (e.Col != 1)
            {
                e.Cancel = true;
            }
        }

        private void VSListKV_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (e.Col != 1)
            {
                e.Cancel = true;
            }
        }

        internal virtual ComboBox CboDonVi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDonVi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDonVi = value;
            }
        }

        internal virtual ComboBox CboKhuVuc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboKhuVuc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboKhuVuc = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdIn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdIn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdIn_Click);
                if (this._CmdIn != null)
                {
                    this._CmdIn.Click -= handler;
                }
                this._CmdIn = value;
                if (this._CmdIn != null)
                {
                    this._CmdIn.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual RadioButton OptChiTiet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptChiTiet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptChiTiet = value;
            }
        }

        internal virtual RadioButton OptTongHop
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptTongHop;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.OptTongHop_CheckedChanged);
                if (this._OptTongHop != null)
                {
                    this._OptTongHop.CheckedChanged -= handler;
                }
                this._OptTongHop = value;
                if (this._OptTongHop != null)
                {
                    this._OptTongHop.CheckedChanged += handler;
                }
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSListDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSListDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSListKV_AfterEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSListKV_BeforeEdit);
                if (this._VSListDoanhThu != null)
                {
                    this._VSListDoanhThu.AfterEdit -= handler;
                    this._VSListDoanhThu.BeforeEdit -= handler2;
                }
                this._VSListDoanhThu = value;
                if (this._VSListDoanhThu != null)
                {
                    this._VSListDoanhThu.AfterEdit += handler;
                    this._VSListDoanhThu.BeforeEdit += handler2;
                }
            }
        }
    }
}

